package com.unionpay.mpds.model;

// default package

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * TransType entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "T_TRANSTYPE", schema = "MPDS")
public class TransType implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -3737841695281187002L;
	private Integer transId;
	private String transName;
	private String transCode;
	private String transFlag;

	// Constructors

	/** default constructor */
	public TransType() {
	}

	/** full constructor */
	public TransType(Integer transId, String transName, String transCode,
			String transFlag) {
		this.transId = transId;
		this.transName = transName;
		this.transCode = transCode;
		this.transFlag = transFlag;
	}

	// Property accessors

	@Id
	@Column(name = "TRANS_ID", nullable = false)
	public Integer getTransId() {
		return this.transId;
	}

	public void setTransId(Integer transId) {
		this.transId = transId;
	}

	@Column(name = "TRANS_NAME", nullable = false, length = 20)
	public String getTransName() {
		return this.transName;
	}

	public void setTransName(String transName) {
		this.transName = transName;
	}

	@Column(name = "TRANS_CODE", nullable = false, length = 20)
	public String getTransCode() {
		return this.transCode;
	}

	public void setTransCode(String transCode) {
		this.transCode = transCode;
	}

	@Column(name = "TRANS_FLAG", nullable = false, length = 1)
	public String getTransFlag() {
		return this.transFlag;
	}

	public void setTransFlag(String transFlag) {
		this.transFlag = transFlag;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof TransType))
			return false;
		TransType castOther = (TransType) other;

		return ((this.getTransId() == castOther.getTransId()) || (this
				.getTransId() != null && castOther.getTransId() != null && this
				.getTransId().equals(castOther.getTransId())))
				&& ((this.getTransName() == castOther.getTransName()) || (this
						.getTransName() != null
						&& castOther.getTransName() != null && this
						.getTransName().equals(castOther.getTransName())))
				&& ((this.getTransCode() == castOther.getTransCode()) || (this
						.getTransCode() != null
						&& castOther.getTransCode() != null && this
						.getTransCode().equals(castOther.getTransCode())))
				&& ((this.getTransFlag() == castOther.getTransFlag()) || (this
						.getTransFlag() != null
						&& castOther.getTransFlag() != null && this
						.getTransFlag().equals(castOther.getTransFlag())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getTransId() == null ? 0 : this.getTransId().hashCode());
		result = 37 * result
				+ (getTransName() == null ? 0 : this.getTransName().hashCode());
		result = 37 * result
				+ (getTransCode() == null ? 0 : this.getTransCode().hashCode());
		result = 37 * result
				+ (getTransFlag() == null ? 0 : this.getTransFlag().hashCode());
		return result;
	}

}